/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tuitionmanagement.DAO;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author XUAN
 */
class DataAccessTable {

    private CallableStatement cs = null;
    private Connection cnDetails = null;

    public DataAccessTable(String tableName) {
    }

    ResultSet getResultSerForDatabaseMetaData(String tableName) throws SQLException {
        DatabaseMetaData meta = cnDetails.getMetaData();
        ResultSet results = meta.getColumns(null, null, tableName, null);

        return results;
    }

    ResultSet getResultSetDetail(String tableName) throws SQLException {
        Statement stDetails_;
        ResultSet rsDetails_ = null;

        stDetails_ = cnDetails.createStatement();
        rsDetails_ = stDetails_.executeQuery("SELECT ROW_NUMBER() OVER (ORDER BY RateDate Asc),  FROM " + tableName + " ORDER BY Name Asc");

        return rsDetails_;
    }

    ResultSet getResultSetSearch(String tableName, Date searchFrom, Date SearchTo) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
